var express = require('express');
var router = express.Router();


router.get('/', function(req, res, next) {
//待写
});

/* post users listing. */
router.post('/', function(req, res, next) {
  //console.log(req.body.username)
  //console.log(req.body.password)
  var resData = {
    "status": 0,
    "message": "",
    "result": {}
  };
  //帐号:zzy 密码:zzyzzy
  if( req.query){
    if(req.query.user === 'zzy'){
      if(req.query.password === 'zzyzzy'){
        resData.status = 1;
        resData.message = "登陆成功";
        res.send(resData);
      }else{
        resData.status = 0;
        resData.message = "密码错误";
        res.send(resData);
      }
    }else{
      resData.status = 0;
      resData.message = "帐号不存在";
      res.send(resData);
    }
  }



  res.send(restRes);
});

router.delete('/', function(req, res, next) {

  var restRes = {
    "status": "FAILED",
    "message": "访问失败",
    "result": {
    }
  }

  res.send(restRes);
});

module.exports = router;
